﻿
using BehaviorDesigner.Runtime.Tasks;

[TaskCategory("Basic/SharedVariable")]
[TaskDescription("Sets the SharedBool variable to the specified object. Returns Success.")]
public class SetSharedEntityStatus : BehaviorDesigner.Runtime.Tasks.Action
{
    [Tooltip("The value to set the SharedEntityStatus to")]
    public SharedEntityStatus targetValue;
    [RequiredField]
    [Tooltip("The SharedEntityStatus to set")]
    public SharedEntityStatus targetVariable;

    public override TaskStatus OnUpdate()
    {
        targetVariable.Value = targetValue.Value;

        return TaskStatus.Success;
    }

    public override void OnReset()
    {
        targetValue = EntityStatusEnum.Idle;
        targetVariable = EntityStatusEnum.Idle;
    }
}
